<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWithdrawalTable extends Migration
{
    /**
     * Run the migrations.
     * 出金表
     * @return void
     */
    public function up()
    {
        Schema::create('withdrawal', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户id');
            $table->decimal('usd_amount',16,4)->nullable()->comment('出金金额美金');
            $table->decimal('del_amount',16,4)->nullable()->comment('手续费');
            $table->decimal('rmb_del_amount',16,4)->nullable()->comment('RMB手续费');
            $table->decimal('rmb_amount_received',16,4)->nullable()->comment('到账人民币金额');
            $table->decimal('rate',16,4)->nullable()->comment('汇率');
            $table->tinyInteger('sp_status')->default('0')->comment('处理状态(0未处理1驳回2通过)');
            $table->tinyInteger('admin_id')->nullable()->comment('审批人id');
            $table->tinyInteger('amount_type')->default('0')->comment('产品类型(1出售产品2停售产品)');
            $table->string('bank_user')->comment('户名');
            $table->string('bank_name')->comment('银行名称');
            $table->string('bank_number')->comment('银行卡号');
            $table->string('bank_address')->comment('开户支行');
            $table->string('notes')->nullable()->comment('注释');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('withdrawal');
    }
}
